package com.didispace;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 翟永超
 * @create 2017/4/15.
 * @blog http://blog.didispace.com
 */
@RestController
public class DcController {

	@Autowired
    DcClient dcClient;

    @GetMapping("/consumer")
    public String dc() {
        return dcClient.consumer();
    }
    
    @GetMapping("/getDc")
    public String getDc() {
        return dcClient.getDc("2", "xiejf");
    }
    
    @PostMapping("/postDc")
    public String postDc() {
        return dcClient.postDc("2", "xiejf");
    }
    
    @PostMapping("/postDc2")
    public String postDc2(String id) {
    	User user = new User();
    	user.setUserName("postDc2");
        return dcClient.postDc2(user, id, "xiejf");
    }
    
    @Autowired
    DcService dcService;
    
    @PostMapping("/postDD")
    public String postDD() {
    	dcService.p();
        return "12345";
    }
    
    @GetMapping("/feignTest")
    public User feignTest() {
        return dcClient.feignTest();
    }
    
}
